Imports SubSonic
Imports ClubStarterKit.Data

Partial Class Blogs_DeleteComment
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If User.IsInRole("Blogger") = True Then
            Dim commenttodelete As Int32
            commenttodelete = CInt(Request("id"))
            Dim commenttodeletestr As String
            commenttodeletestr = CStr(Request("id"))
            If commenttodeletestr Is Nothing Then
                Response.Redirect("~/blogs/default.aspx")
            Else
                Dim delqry As New Query(Tables.BlogComments)
                delqry.QueryType = QueryType.Delete
                delqry.AddWhere(BlogComments.Columns.Commentid, commenttodelete)
                delqry.Execute()
                Response.Redirect("~/blogs/default.aspx")
            End If
        End If
    End Sub
End Class
